<div id="content" class="profile">
    <h1><?=$data->TITLE?></h1>
    <h3><?=sprintf(_('%sclick to%s show your profile.'),'<a href="/'.LANG.'/profile">','</a>')?></h3>
    <form id="form" method="post" action="/json<?=PREFIX.'/'.APP.'/'.CMD?>">
        <h2><span><?=_('Basic Information')?></span></h2>
        <div class="formLineLight">
            <label class="formLabel"><?=_('Username')?>:  </label><span class="input required">
                <input id="username" name="username" type="text" tabindex="1" value="<?=$data->profile->username?>" />
            </span>
            <span class="clear"></span>
            <span class="formLineDesc"><?=sprintf(_('ex: http://%s/username'),DOMAIN)?></span>
            <span class="formLineDesc"><?=_('The username can only include; lowercase letters, numbers and dash.')?></span>
            <span class="clear"></span>
        </div>
        <div class="formLineDark">
            <label class="formLabel"><?=_('Full name')?>:  </label>
            <span class="input required"><input id="name" name="name" type="text" tabindex="4" value="<?=$data->profile->name.' '.$data->profile->lastname?>" /></span>
            <span class="clear"></span>
        </div>
        <?if(PROFILE_SEX_CHANGABLE):?>
        <div class="formLineLight">
            <label class="formLabel"><?=_('Sex')?>:  </label>
            <span class="select required">
                <select id="sex" name="sex" tabindex="5">
                    <option value="female" <?=$data->profile->sex=='female'?'selected="selected"':''?>><?=_('Female')?></option>
                    <option value="male" <?=$data->profile->sex=='male'?'selected="selected"':''?>><?=_('Male')?></option>
                </select>
            </span>
            <span class="clear"></span>
        </div>
        <?endif;?>
        <div class="formLineDark">
            <label class="formLabel"><?=_('Birth date')?>:  </label>
            <span class="date required">
                <select id="year" name="year" onchange="tool.setday('year','month','day');" tabindex="6">
                    <option><?=_('Year')?></option>
                </select>
                <select id="month" name="month" onchange="tool.setday('year','month','day');" tabindex="7">
                    <option><?=_('Month')?></option>
                </select>
                <select id="day" name="day" tabindex="8">
                    <option><?=_('Day')?></option>
                </select>
            </span>
            <span class="clear"></span>
        </div>
        <div class="formLineDark">
            <label class="formLabel"><?=_('Relationship status')?>:  </label>
            <span class="select required">
                <select id="relationshipStatus" name="relationshipStatus" tabindex="5">
                    <option value="single" <?=$data->profile->relationshipStatus=='single'?'selected="selected"':''?>><?=_('Single')?></option>
                    <option value="relationship" <?=$data->profile->relationshipStatus=='relationship'?'selected="selected"':''?>><?=_('In a relationship')?></option>
                    <option value="engaged" <?=$data->profile->relationshipStatus=='engaged'?'selected="selected"':''?>><?=_('Engaged')?></option>
                    <option value="married" <?=$data->profile->relationshipStatus=='married'?'selected="selected"':''?>><?=_('Married')?></option>
                    <option value="complicated" <?=$data->profile->relationshipStatus=='complicated'?'selected="selected"':''?>><?=_('It\'s complicated')?></option>
                    <option value="open-relationship" <?=$data->profile->relationshipStatus=='open-relationship'?'selected="selected"':''?>><?=_('In an open relationship')?></option>
                    <option value="widowed" <?=$data->profile->relationshipStatus=='windowed'?'selected="selected"':''?>><?=_('Windowed')?></option>
                </select>
            </span>
            <span class="clear"></span>
        </div>
        <div class="formLineLight">
            <label class="formLabel"><?=_('Interested in')?>:</label>
            <span class="checkbox">
                <a class="checkboxItem<?=$data->profile->interestedIn->men?' checked':''?>" title="interestedInMen"><span class="check"><span>&nbsp;</span></span><?=_('Men')?></a>
                <input id="interestedInMen" name="interestedInMen" type="hidden" value="<?=$data->profile->interestedIn->men?>" />
                <span class="clear"></span>
                <a class="checkboxItem<?=$data->profile->interestedIn->women?' checked':''?>" title="interestedInWomen"><span class="check"><span>&nbsp;</span></span><?=_('Women')?></a>
                <input id="interestedInWomen" name="interestedInWomen" type="hidden" value="<?=$data->profile->interestedIn->women?>" />
            </span>
            <span class="clear"></span>
        </div>
        <div class="formLineDark">
            <label class="formLabel"><?=_('Looking for')?>:</label>
            <span class="checkbox">
                <a class="checkboxItem<?=$data->profile->lookingFor->friendship?' checked':''?>" title="lookingForFriendship"><span class="check"><span>&nbsp;</span></span><?=_('Friendship')?></a>
                <input id="lookingForFriendship" name="lookingForFriendship" type="hidden" value="<?=$data->profile->lookingFor->friendship?>" />
                <span class="clear"></span>
                <a class="checkboxItem<?=$data->profile->lookingFor->dating?' checked':''?>" title="lookingForDating"><span class="check"><span>&nbsp;</span></span><?=_('Dating')?></a>
                <input id="lookingForDating" name="lookingForDating" type="hidden" value="<?=$data->profile->lookingFor->dating?>" />
                <span class="clear"></span>
                <a class="checkboxItem<?=$data->profile->lookingFor->relationship?' checked':''?>" title="lookingForRelationship"><span class="check"><span>&nbsp;</span></span><?=_('A relationship')?></a>
                <input id="lookingForRelationship" name="lookingForRelationship" type="hidden" value="<?=$data->profile->lookingFor->relationship?>" />
                <span class="clear"></span>
                <a class="checkboxItem<?=$data->profile->lookingFor->networking?' checked':''?>" title="lookingForNetworking"><span class="check"><span>&nbsp;</span></span><?=_('Networking')?></a>
                <input id="lookingForNetworking" name="lookingForNetworking" type="hidden" value="<?=$data->profile->lookingFor->networking?>" />

            </span>
            <span class="clear"></span>
        </div>
        <h2><span><?=_('Hometown')?></span></h2>
        <div class="formLineLight">
            <label class="formLabel"><?=_('Country')?>:  </label>
            <span class="select required">
                <select id="homeCountry" name="homeCountry" tabindex="9" onchange="tool.regions('/json/common/regions/'+$(this).val(),'homeRegion');">
                    <option value="0"><?=_('Select a country')?></option>
                </select>
            </span>
            <span class="clear"></span>
        </div>
        <div class="formLineLight">
            <label class="formLabel"><?=_('Region')?>:  </label>
            <span class="select required">
                <select id="homeRegion" name="homeRegion" tabindex="10">
                    <option value="0"><?=_('Select a region')?></option>
                </select>
            </span>
            <span class="clear"></span>
        </div>
        <h2><span><?=_('Education and Work')?></span></h2>
        <div class="formLineDark">
            <label class="formLabel"><?=_('High School')?>:  </label>
            <span class="input required"><input id="highschool" name="highschool" type="text" tabindex="4" value="<?=$data->profile->highschool?>" /></span>
            <span class="clear"></span>
        </div>
        <div class="formLineDark">
            <label class="formLabel"><?=_('University')?>:  </label>
            <span class="input required"><input id="university" name="university" type="text" tabindex="4" value="<?=$data->profile->university?>" /></span>
            <span class="clear"></span>
        </div>
        <div class="formLineDark">
            <label class="formLabel"><?=_('Occupation')?>:  </label>
            <span class="input required"><input id="occupation" name="occupation" type="text" tabindex="4" value="<?=$data->profile->occupation?>" /></span>
            <span class="clear"></span>
        </div>
        <div class="formLineDark">
            <label class="formLabel"><?=_('Companies')?>:  </label>
            <span class="input required"><input id="companies" name="companies" type="text" tabindex="4" class="formLineWide" value="<?=$data->profile->companies?>" /></span>
            <span class="formLineDesc"><?=_('Separate multiple with commas')?></span>
        </div>

        <h2><span><?=_('Personal Information')?></span></h2>
        <?/*<div class="formLineDark">
            <label class="formLabel"><?=_('Height')?>:  </label>
            <span class="input required"><input id="height" name="height" type="text" tabindex="4" value="<?=$data->profile->height?>" /></span>
            <span class="clear"></span>
        </div>
        <div class="formLineDark">
            <label class="formLabel"><?=_('Weight')?>:  </label>
            <span class="input required"><input id="weight" name="weight" type="text" tabindex="4" value="<?=$data->profile->height?>" /></span>
            <span class="clear"></span>
        </div>
        <div class="formLineDark">
            <label class="formLabel"><?=_('Eye Color')?>:  </label>
            <span class="input required"><input id="eyecolor" name="eyecolor" type="text" tabindex="4" value="<?=$data->profile->height?>" /></span>
            <span class="clear"></span>
        </div>
        <div class="formLineDark">
            <label class="formLabel"><?=_('Hair Color')?>:  </label>
            <span class="input required"><input id="haircolor" name="haircolor" type="text" tabindex="4" value="<?=$data->profile->height?>" /></span>
            <span class="clear"></span>
        </div>*/?>
        <div class="formLineDark">
            <label class="formLabel"><?=_('About me')?>:  </label>
            <span class="input required"><textarea id="about" name="about" tabindex="4" class="formLineWide"><?=$data->profile->about?></textarea></span>
            <span class="formLineDesc">Describe yourself</span>
        </div>
        <h2><span><?=_('Contact Information')?></span></h2>
        <div class="formLineLight">
            <label class="formLabel"><?=_('Country')?>:  </label>
            <span class="select required">
                <select id="country" name="country" tabindex="9" onchange="tool.regions('/json/common/regions/'+$(this).val(),'region');">
                    <option value="0"><?=_('Select a country')?></option>
                </select>
            </span>
            <span class="clear"></span>
        </div>
        <div class="formLineLight">
            <label class="formLabel"><?=_('Region')?>:  </label>
            <span class="select required">
                <select id="region" name="region" tabindex="10">
                    <option value="0"><?=_('Select a region')?></option>
                </select>
            </span>
            <span class="clear"></span>
        </div>
        <div class="formLineLight">
            <span class="submit">
                <span id="loader" class="loader"><img src="/themes/<?=THEME?>/images/loader.gif" alt="loader" /></span>
                <input id="ID" name="ID" type="hidden" value="<?=$data->profile->ID?>" />
                <input id="submit" class="submit" type="submit" value="<?=_('Save')?>" tabindex="9" />
                <span class="clear"></span>
            </span>
            <span class="clear"></span>
        </div>
    </form>
    <div class="clear"></div>
</div>
<div id="aside">
</div>
<script type="text/javascript">
    /*var basics = "[{ID:1, label:'Hometown'}, {ID:2, label:'Relationship Status'}, {ID:3, label:'Interested in'}, {ID:4, label:'Looking for'}]";
new mooCompleter('label1',basics);*/
</script>
<script type="text/javascript">
    tool.countries('/json/common/countries','homeCountry','<?=$data->profile->hometown->country->code?>');
    tool.regions('/json/common/regions/<?=$data->profile->hometown->country->code?>','homeRegion','<?=$data->profile->hometown->region->code?>');
    tool.countries('/json/common/countries','country','<?=$data->profile->contact->country->code?>');
    tool.regions('/json/common/regions/<?=$data->profile->contact->country->code?>','region','<?=$data->profile->contact->region->code?>');
    tool.birthdate(<?=@date('Y')-18?>,<?=@date('Y')-88?>,'<?=$data->profile->birthday?$data->profile->birthday:'0000-00-00'?>');
    tool.form(1);
</script>
